package com.bbzn.user.client.service.impl;

import com.bbzn.user.client.dataobject.Permission;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.bbzn.user.client.dao.role.RolePermissionMapper;
import com.bbzn.user.client.dataobject.RolePermission;
import com.bbzn.user.client.service.RolePermissionService;
@Service
public class RolePermissionServiceImpl implements RolePermissionService{

    @Resource
    private RolePermissionMapper rolePermissionMapper;

    @Override
    public int deleteByPrimaryKey(Integer roleId,Long permId) {
        return rolePermissionMapper.deleteByPrimaryKey(roleId,permId);
    }

    @Override
    public int deleteByRoleId(Integer roleId) {
        return rolePermissionMapper.deleteByRoleId(roleId);
    }

    @Override
    public int insert(RolePermission record) {
        return rolePermissionMapper.insert(record);
    }

    @Override
    public int insertOrUpdate(RolePermission record) {
        return rolePermissionMapper.insertOrUpdate(record);
    }

    @Override
    public int insertOrUpdateSelective(RolePermission record) {
        return rolePermissionMapper.insertOrUpdateSelective(record);
    }

    @Override
    public int insertSelective(RolePermission record) {
        return rolePermissionMapper.insertSelective(record);
    }

    @Override
    public List<RolePermission> findByAll(RolePermission rolePermission) {
        return rolePermissionMapper.findByAll(rolePermission);
    }

    @Override
    public int updateBatch(List<RolePermission> list) {
        return rolePermissionMapper.updateBatch(list);
    }

    @Override
    public int updateBatchSelective(List<RolePermission> list) {
        return rolePermissionMapper.updateBatchSelective(list);
    }

    @Override
    public int batchInsert(List<RolePermission> list) {
        return rolePermissionMapper.batchInsert(list);
    }

    @Override
    public List<RolePermission> getRolePermissionByPerId(List<Long> ids) {
        return rolePermissionMapper.getRolePermissionByPerId(ids);
    }

    @Override
    public List<Long> findPermissionIdByRoleId(int roleId) {
        return rolePermissionMapper.findPermissionIdByRoleId(roleId);
    }

}
